package gold.digger;

import gold.utils.InputUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LC867 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int[][] transpose(int[][] matrix) {
            if (null == matrix || matrix.length <= 0) return matrix;
            int[][] result = new int[matrix[0].length][matrix.length];
            for (int i = 0; i < matrix.length; i++) {
                for (int j = 0; j < matrix[0].length; j++) {
                    result[j][i] = matrix[i][j];
                }
            }

            return result;
        }
    }

    public void run() {
        Solution solution = new Solution();
        int[][] arr = InputUtil.toDoubleIntegerArray("[[1,2,3],[4,5,6]]");
        System.out.println(solution.transpose(arr));
    }

    public static void main(String[] args) throws Exception {
        LC867 an = new LC867();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
